package com.jerry.consumer.config;

import com.netflix.loadbalancer.IRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class LoadBalanceConfig {
	
	@Bean
	@LoadBalanced        //为RestTemplate整合Ribbon提供负载均衡的能力
	public RestTemplate getRestTemplate() {
		return new RestTemplate();
	}

//	@Bean
//	public IRule loadMyRule() {
//		//使用自定义的算法
//		return new CustomRule();
//	}

}
